home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
dev
/
gcc
/
libnixV1_0.lha
/
gnu
/
libnix-sources.lha
/
sources
/
headers
/
strsup.h
< prev
Wrap
C/C++ Source or Header
|
1995-01-22
|
715b
|
51 lines
#ifndef _STRSUP_H /* don't include this twice */
#define _STRSUP_H
#if defined(__GNUC__) && defined(__OPTIMIZE__)
extern __inline char *strcat(char *s1,const char *s2)
{
char *s=s1;
while(*s++)
;
--s;
while((*s++=*s2++))
;
return s1;
}
extern __inline char *strcpy(char *s1,const char *s2)
{ char *s=s1;
do
*s++=*s2;
while(*s2++!='\0');
return s1;
}
extern __inline size_t strlen(const char *string)
{
const char *s=string;
while(*s++)
;
return ~(string-s);
}
extern __inline size_t strlen_plus_one(const char *string)
{
const char *s=string;
while(*s++)
;
return (s-string);
}
#else
#define strlen_plus_one(s) strlen(s)+1 /* not gnu :( */
#endif
#endif